package com.ybkj.daijia.serverUtils;

import org.apache.commons.lang3.StringUtils;


public class FilterStrUtil {

    public static boolean check(String sourceStr, String filterStr) {

        if (StringUtils.isBlank(sourceStr) || StringUtils.isBlank(filterStr)) {
            return true;
        }

        String[] filterArr = filterStr.split(",");
        if (null == filterArr || filterArr.length == 0) {
            return true;
        }

        boolean result = true;
        for (String str : filterArr) {
            if (StringUtils.isNotBlank(str)) {
                if (sourceStr.contains(str)) {
                    result = false;
                    break;
                }
            }
        }

        return result;
    }

}
